package com.tencent.qf.bascic.controller;

import com.tencent.qf.bascic.controller.req.DataCollectRequest;
import com.tencent.qf.bascic.controller.req.DataReportRequest;
import com.tencent.qf.bascic.service.DataReportService;
import com.tencent.qf.common.aspect.annotation.ApiLog;
import com.tencent.qf.common.aspect.annotation.Signature;
import com.tencent.qf.common.exception.ErrorCode;
import com.tencent.qf.common.pojo.HttpResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/api/basic")
public class KafkaDataCollectController {

    @Resource
    private DataReportService dataReportService;

    @Signature
    @ApiLog("数据收集")
    @PostMapping("/data/collect")
    public HttpResult<Boolean> dataCollect(@RequestBody @Valid DataCollectRequest request){
        return dataReportService.dataCollect(request);
    }
}
